473,461 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XSD datatype for binary ASCII data for a Tag in XML

hi,

hey! i am writing an XML Schema Defination where i got a sistutation
in such way that i need to defina a tag that should hold binary data
(ASCII data). How can i handle this sistutation? I mean what datatype
i need to mention.
i saw the base64Binary data type but it will not support all the ascii
characters right? In this scenario can any one please give me a
thought?

Thanks much,
Sha
Feb 26 '08 #1
5 3613
sh*******************@gmail.com wrote:
hey! i am writing an XML Schema Defination where i got a sistutation
in such way that i need to defina a tag that should hold binary data
(ASCII data). How can i handle this sistutation? I mean what datatype
i need to mention.
i saw the base64Binary data type but it will not support all the ascii
characters right? In this scenario can any one please give me a
thought?
You will need to encode the binary data for storing it in XML and then
decode it when parsing it out of the XML.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 26 '08 #2
On 26 Feb, 18:24, shashidhar.yarlaga...@gmail.com wrote:
hi,

hey! i am writing an XML Schema Defination where i got a sistutation
in such way that i need to defina a tag that should hold binary data
(ASCII data). How can i handle this sistutation? I mean what datatype
i need to mention.
i saw the base64Binary data type but it will not support all the ascii
characters right? In this scenario can any one please give me a
thought?

Thanks much,
Sha
hexBinary is another alternative. It's simpler than base64Binary, but
not as efficient. You can read about how they encode data at:

http://www.w3.org/TR/xmlschema11-2/#hexBinary
http://www.w3.org/TR/xmlschema11-2/#base64Binary

Refer to the referenced IETF RFC (http://www.ietf.org/rfc/rfc3548.txt)
to find out how base64 is encoded.

HTH,

Pete Cordell
Codalogic
For XML C++ data binding visit http://www.codalogic.com/lmx/
Feb 26 '08 #3
How "binary" is your "binary"? (Or, to be more accurate, how ASCII is it?)

The other approach would be to invent your own escaping system for the
control characters (either as special elements, or as some syntax in the
text such as the old ^C for control-C), use XML's escapes for the few
other ASCII characters which need special handling, and let the schema
just declare it as a string. Depending on what you're doing that might
be significantly more compact than the base-64 solution.
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Feb 26 '08 #4
On Feb 26, 2:23*pm, use...@tech-know-ware.com wrote:
On 26 Feb, 18:24, shashidhar.yarlaga...@gmail.com wrote:
hi,
hey! i am writing an XML Schema Defination where i got a sistutation
in such way that i need to defina a tag that should hold binary data
(ASCII data). How can i handle this sistutation? I mean what datatype
i need to mention.
i saw the base64Binary data type but it will not support all the ascii
characters right? In this scenario can any one please give me a
thought?
Thanks much,
Sha

hexBinary is another alternative. *It's simpler than base64Binary, but
not as efficient. *You can read about how they encode data at:

http://www.w3.org/TR/xmlschema11-2/#.../#base64Binary

Refer to the referenced IETF RFC (http://www.ietf.org/rfc/rfc3548.txt)
to find out how base64 is encoded.

HTH,

Pete Cordell
Codalogic
For XML C++ data binding visithttp://www.codalogic.com/lmx/
Thanks much for the information.
Feb 27 '08 #5
On Feb 26, 3:08*pm, Joseph Kesselman <keshlam-nos...@comcast.net>
wrote:
How "binary" is your "binary"? (Or, to be more accurate, how ASCII is it?)

The other approach would be to invent your own escaping system for the
control characters (either as special elements, or as some syntax in the
text such as the old ^C for control-C), use XML's escapes for the few
other ASCII characters which need special handling, and let the schema
just declare it as a string. Depending on what you're doing that might
be significantly more compact than the base-64 solution.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Thanks much for the information.
Feb 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bix | last post by:
As this is my very first post, I'd like to give thanks to all who support this with their help. Hopefully, this question hasn't been answered (too many times) before... If anyone could explain...
1
by: Ferran Foz | last post by:
Hello, I'm using ADODB.Stream to open a binary file on the server and write it down to the browser using Response.BinaryWrite. It's working fine, but i need to make some changes to the binary...
10
by: J. Campbell | last post by:
OK...I'm in the process of learning C++. In my old (non-portable) programming days, I made use of binary files a lot...not worrying about endian issues. I'm starting to understand why C++ makes...
13
by: greg | last post by:
Hello, I'm searching to know if a local file is ascii or binary. I couldn't find it in the manual, is there a way to know that ? thanks, -- greg
6
by: SandyMan | last post by:
Hi, I am able to open a binary file for reading but can someone tell me as how to go about converting a Binary file to ASCII file using C. Thanks In Advance SandyMan
6
by: as400tips | last post by:
I have a Binary Data file (Packed Decimal and ASCII mixed) and would like to convert into ASCII (readable) file. How to do it in C#? Thanks.
11
by: Freddy Coal | last post by:
Hi, I'm trying to read a binary file of 2411 Bytes, I would like load all the file in a String. I make this function for make that: '-------------------------- Public Shared Function...
3
by: logaelo | last post by:
Hello all, Could anyone explain how to optimization this code? In the prosess of optimization what is the factor needed and important to know about it? Thank you very much for all. ...
5
by: dm3281 | last post by:
Hello, I have a text report from a mainframe that I need to parse. The report has about a 2580 byte header that contains binary information (garbage for the most part); although there are a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.